package com.ruoyi.recipes.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.recipes.mapper.RecipeIngredientsMapper;
import com.ruoyi.recipes.domain.RecipeIngredients;
import com.ruoyi.recipes.service.IRecipeIngredientsService;

import javax.annotation.Resource;

/**
 * 菜谱用料明细Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-13
 */
@Service
public class RecipeIngredientsServiceImpl implements IRecipeIngredientsService 
{
    @Resource
    private RecipeIngredientsMapper recipeIngredientsMapper;

    /**
     * 查询菜谱用料明细
     * 
     * @param id 菜谱用料明细主键
     * @return 菜谱用料明细
     */
    @Override
    public RecipeIngredients selectRecipeIngredientsById(Long id)
    {
        return recipeIngredientsMapper.selectRecipeIngredientsById(id);
    }

    /**
     * 查询菜谱用料明细列表
     * 
     * @param recipeIngredients 菜谱用料明细
     * @return 菜谱用料明细
     */
    @Override
    public List<RecipeIngredients> selectRecipeIngredientsList(RecipeIngredients recipeIngredients)
    {
        return recipeIngredientsMapper.selectRecipeIngredientsList(recipeIngredients);
    }

    /**
     * 新增菜谱用料明细
     * 
     * @param recipeIngredients 菜谱用料明细
     * @return 结果
     */
    @Override
    public int insertRecipeIngredients(RecipeIngredients recipeIngredients)
    {
        return recipeIngredientsMapper.insertRecipeIngredients(recipeIngredients);
    }

    /**
     * 修改菜谱用料明细
     * 
     * @param recipeIngredients 菜谱用料明细
     * @return 结果
     */
    @Override
    public int updateRecipeIngredients(RecipeIngredients recipeIngredients)
    {
        return recipeIngredientsMapper.updateRecipeIngredients(recipeIngredients);
    }

    /**
     * 批量删除菜谱用料明细
     * 
     * @param ids 需要删除的菜谱用料明细主键
     * @return 结果
     */
    @Override
    public int deleteRecipeIngredientsByIds(Long[] ids)
    {
        return recipeIngredientsMapper.deleteRecipeIngredientsByIds(ids);
    }

    /**
     * 删除菜谱用料明细信息
     * 
     * @param id 菜谱用料明细主键
     * @return 结果
     */
    @Override
    public int deleteRecipeIngredientsById(Long id)
    {
        return recipeIngredientsMapper.deleteRecipeIngredientsById(id);
    }
}
